import Vue from 'vue'
import App from './App'
import uView from "uview-ui";
import topBar from "@/components/topBar"
import dhImage from '@/components/errorImg/dh-image'
import limePainter from '@/components/limePainter/index'
import authorLogin from '@/components/authorLogin/author-login'
import authorPhone from '@/components/authorPhone/author-phone'
import nLoading from '@/components/loading/n-loading'
import tabs from '@/components/tabs/tabs'
import store from 'store/index.js'
import {geturl,Get,Post,uploadImg,testToken,showLoadGo} from './common/api/api.js'
import {getdate,timeRange,dateType,geoDistance,dateDiff,endCountDown,resolvingScene} from './common/api/find.js'


Vue.prototype.geturl = geturl
Vue.prototype.apiget = Get
Vue.prototype.apipost = Post
Vue.prototype.uploadImg = uploadImg
Vue.prototype.testToken = testToken
Vue.prototype.showLoadGo = showLoadGo
Vue.component("top-bar", topBar);
Vue.component("dh-image", dhImage);
Vue.component("lime-painter", limePainter);
Vue.component("author-login", authorLogin);
Vue.component("author-phone", authorPhone);
Vue.component("n-loading", nLoading);
Vue.component("tabs", tabs);

Vue.prototype.getdate = getdate  // 时间戳转化
Vue.prototype.dateType = dateType //格式化当前时间
Vue.prototype.timeRange = timeRange //营业时间判断
Vue.prototype.geoDistance = geoDistance //距离
Vue.prototype.dateDiff = dateDiff //计算倒计时
Vue.prototype.endCountDown = endCountDown //起始时间计算倒计时
Vue.prototype.resolvingScene = resolvingScene //解析小程序码参数
Vue.config.productionTip = false


import fly from './store/fly'
Vue.prototype.$fly = fly;

/*base定义全局函数*/
//写一个模块文件，挂载到main.js上面
import base from './store/base'//引用
Vue.use(base); //使用Vue.use将全局函数当做插件来进行注册,组件里面调用直接使用this.fun()调用函数

App.mpType = 'app'
Vue.use(uView);


const app = new Vue({
	...App,
	 store: store,
})
app.$mount()
